﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;


namespace UpLoad
{
    public class Config
    {
    
        /// <summary>
        /// 常用的音频格式
        /// </summary>
        public static string[] musicsuffixs = { ".cd", ".wave", ".wav", ".aiff", ".au", ".mp3", ".midi", ".wma", ".realaudio", ".vqf", ".aac", ".ape" };
        /// <summary>
        /// 常用的视频格式
        /// </summary>
        public static string[] videosuffixs = { ".mkv", ".mp4", ".mov", ".rm", ".rmvb", ".wmv", ".avi", ".vob", ".swf", ".flv" };
        /// <summary>
        /// 常用的图片格式
        /// </summary>
        public static string[] imagesuffixs = { ".bmp", ".jpg", ".tiff", ".gif", ".pcx", ".tga", ".exif", ".fpx", ".svg", ".psd", ".cdr", ".pcd", ".dxf", ".ufo", ".eps", ".ai", ".raw" };

        public static string ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];            //数据库连接字符串

        public static string DefaultPath = ConfigurationManager.AppSettings["DefaultPath"];                 //默认上传路径
        public static string ImageUploadPath = ConfigurationManager.AppSettings["ImageUploadPath"];            //上传图片的路径
        public static string VideoUploadPath = ConfigurationManager.AppSettings["VideoUploadPath"];            //上传视频的路径
        public static string MusicUploadPath = ConfigurationManager.AppSettings["MusicUploadPath"];             //上传音频的路径


        public static string DefaultServerPath = ConfigurationManager.AppSettings["DefaultServerPath"] == null ? DefaultPath : ConfigurationManager.AppSettings["DefaultServerPath"];          //默认获取文件的路径
        public static string ImageServerPath = ConfigurationManager.AppSettings["ImageServerPath"] == null ? ImageUploadPath : ConfigurationManager.AppSettings["ImageServerPath"];            //获取图片时的路径
        public static string VideoServerPath = ConfigurationManager.AppSettings["VideoServerPath"] == null ? VideoUploadPath : ConfigurationManager.AppSettings["VideoServerPath"];            //获取视频时的路径
        public static string MusicServerPath = ConfigurationManager.AppSettings["MusicServerPath"] == null ? MusicUploadPath : ConfigurationManager.AppSettings["MusicServerPath"];            //获取音频时的路径


        public static int thumbnailWidth = Convert.ToInt32(ConfigurationManager.AppSettings["thumbnailWidth"]);             //缩略图宽度
        public static int thumbnailHeight = Convert.ToInt32(ConfigurationManager.AppSettings["thumbnailHeight"]);           //缩略图高度
        public static double multiple = double.Parse(ConfigurationManager.AppSettings["multiple"]);                         //缩放倍数
    }
}
